package com.cpd.blog.common.utils;

import org.springframework.stereotype.Component;

import java.time.Duration;
import java.time.LocalDateTime;

/**
 * @Author: Copydown
 * @Date: 2022/05/06/18:45
 */
@Component
public class TimeUtil {

    public static long getNanoNowMinusDay(int day) {
        return System.currentTimeMillis() - Duration.ofDays(day).getNano();
    }

    public static LocalDateTime getNowLocalDateTime() {
        return LocalDateTime.now();
    }

}

